package com.ryan.spring.annotation.ext;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * Created by kaimin on 17/2/2019.
 * time : 21:48
 */
@Component//生效
public class MyApplicationListner implements ApplicationListener<ApplicationEvent> {

    //ApplicationEvent,容器中所有的事件都会订阅
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        System.out.println("receive event："+event);
    }
}
